package com.xiang.mall.platform.uc.controller

import com.xiang.mall.platform.uc.model.dto.UserInfoDto
import com.xiang.mall.platform.uc.service.UserService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

/**
 * @author xiangliyou
 * @email xiangliyou1814@mail.yneusoft.com
 * @date 2019-03-12 14:37
 *
 */
@RestController
@RequestMapping("userInfo")
class UserInfoController {

    @Autowired
    private lateinit var userService: UserService

    /**
     * 添加用户
     */
    @PostMapping("add")
    fun add(@RequestBody user: UserInfoDto): Boolean {
        return userService.add(user)
    }

    /**
     * 通过用户名查找用户信息
     */
    @GetMapping("findUserByUsername")
    fun findUserByUsername(username: String): UserInfoDto? {
        return userService.findUserByUsername(username)
    }

}